package com.yonyou.crm.sprc.lead.rmimpl;

import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.yonyou.crm.common.page.entity.Page;
import com.yonyou.crm.sprc.lead.entity.LeadVO;
import com.yonyou.crm.sprc.lead.rmitf.ILeadRmService;
import com.yonyou.crm.sprc.lead.service.LeadBizServiceImpl;

@Service("leadService")
public class LeadRmServiceImpl implements ILeadRmService {

	@Autowired
	private LeadBizServiceImpl service;
	
	@Override
	public Page<LeadVO> page(Page<LeadVO> page, Map<String, Object> paraMap) {
		return service.getPage(page, paraMap);
	}

	@Override
	public LeadVO detail(Long id) {
		return service.getDetail(id);
	}

	@Override
	public LeadVO insert(LeadVO vo) {
		service.save(vo);
		return service.getDetail(vo.getId());
	}
	
	@Override
	public LeadVO insert(LeadVO vo, Map<String, Object> param){
		return service.save(vo, param);
	}

	@Override
	public LeadVO update(LeadVO vo) {
		service.updateVO(vo);
		return service.getDetail(vo.getId());
	}

	@Override
	public String batchDelete(String[] ids) {
		return service.batchDelete(ids);
	}

	@Override
	public Page<LeadVO> batchUpdateEnableState(String[] ids,
			Integer enableState, Page<LeadVO> page, Map<String, Object> paraMap) {
		return null;
	}
	
	@Override
	public int insertFollow(Long id) {
		return service.saveFollow(id);
	}

	@Override
	public int deleteFollow(Long id) {
		return service.deleteFollow(id);
	}

}
